<%-- 
    Document   : content
    Created on : Oct 25, 2010, 11:49:09 AM
    Author     : M Bilal
--%>
<%@ page import="wap.rockvilletech.portal.DBProc"%>
<%@ page import="java.io.*,java.sql.*,java.net.*"%>
<%@ page import="org.apache.log4j.Logger" %>

<%@ include file="../includes/header.jspf"%>

<%
final Logger log = Logger.getLogger("JSP.CONTENT.NEWS");
    thisPage = "News-NewsContent";
    DBProc db=DBProc.getInstance();
    int image_width = (int) (wurfl_screenWidth * 0.96);
    String ititle = "", idesc = "", iGuid = "", thumb = "",feedDate = "";
    app = request.getParameter("app") != null ? request.getParameter("app") : "";
    String newsItemID = request.getParameter("newsitemid") != null ? request.getParameter("newsitemid") : "0";
    String pid = request.getParameter("pid") != null ? request.getParameter("pid") : "0";
    tags = (request.getParameter("txtsrh") != null ? request.getParameter("txtsrh") : "");
    String strThisPageRequestUrl=wap.rockvilletech.util.RequestUrlHelper.getRequest_QueryString_CurrentPage(request,"content.jsp");

	String feedId,str_feed_title; 
	feedId=request.getParameter("feed");
	if(feedId == null) {
		feedId="";
	}
	str_feed_title=request.getParameter("ftitle");
	if(str_feed_title == null) {
		str_feed_title="";
	}
%>
<div style="padding: 0px 0px 0px 0px;">
    <div class="div_navigation" id="div_navigation">
        <a href="<%=context_Path%>" class="LinkIndex">Home</a>&nbsp;&gt;
        <%
        if("55".equals(str_feed_title)){
        	%><a href="<%=context_Path%>/finance/finance.jsp" class="LinkIndex">Finance</a>&nbsp;&gt;<%
        } 
        else if("59".equals(str_feed_title)){
        	%><a href="<%=context_Path%>/cricket" class="LinkIndex">Cricket</a>&nbsp;&gt;<%
        } 
        else{
        	%><a href="<%=context_Path%>/news/news.jsp" class="LinkIndex">News</a>&nbsp;&gt;<%
        }
        str_feed_title = wpb.coolStuffMapping(str_feed_title);
        %>
        <span class="navigation_Leaf"><%= str_feed_title %></span>
    </div>
</div>
<%
app=str_feed_title;

Vector vNewsDetail = db.getNewsDetail(newsItemID);
    if (vNewsDetail!=null) {
        
%>
<div>
         <table width="100%" align="left" cellpadding="0" cellspacing="0" style="text-align: left;font-weight: bold;">
                <tr>
                    <td style="background-image:url('../images/new/top_bar_02.jpg');background-repeat: repeat-x;height:26px;">
                        <b style="padding:0px 0px 0px 3px;"><%=str_feed_title%></b>
                    </td>
                 </tr>
            </table>
</div>
<div style="clear: both;"></div>

<div id="newsBlock" class="newsBlock" align="center">
  <div id="newBloackWidthMainter" class="newBloackWidthMainter">
<%
            try {
                ititle = vNewsDetail.get(1)!=null?vNewsDetail.get(1).toString():"";
                ititle = wap.rockvilletech.util.StringUtils.toUnicode(ititle);

                feedDate = vNewsDetail.get(2).toString();
                thumb = vNewsDetail.get(4)!=null?vNewsDetail.get(4).toString():"";
                idesc = vNewsDetail.get(3).toString();
                idesc = wap.rockvilletech.util.StringUtils.toUnicode(idesc);
                //log.debug("idesc: "+idesc);
                //idesc=wap.rockvilletech.util.StringHelper.unescapeHTML(idesc);
                try{ idesc=java.net.URLDecoder.decode(idesc,"UTF-8"); }catch(Exception exDecode){}

                try{ ititle=java.net.URLDecoder.decode(ititle,"UTF-8"); }catch(Exception exDecode){}

                if (idesc.toLowerCase().contains("feedflare")) {
                    idesc = idesc.substring(0, idesc.indexOf("<div class=\"feedflare"));
                }

                if (thumb != null && thumb.length() > 1) {
                    thumb = java.net.URLEncoder.encode(thumb, "UTF-8");
%>
                <div id="feedImage" class="feedImage">
                        <img src="<%=context_Path%>/imgsrv?img=<%=thumb%>&s=0&repo=http&w=<%=image_width%>" style="<%=css_Img%>" alt="" />
                </div>
<%
                }
%>
	            <div id="feedHeading" class="feedHeading"><%=ititle%></div>
	            <div id="feedDateTime"><%=feedDate%></div>
	            <div id="feedDescription" class="feedDescription"><%=idesc%></div>
	            <br/>
	            <table width="100%" cellpadding="0" cellspacing="0"><tr>
	            <%
	            int[] itemIds = db.getNextPrevIds(feedId, newsItemID);
	            if(itemIds[0] > 0 /*|| tags.length() > 0*/) {
	            	%><td><a class="LinkIndex" href="content.jsp?page=<%=thisPage%>&feed=<%=feedId%>&ftitle=<%=feedId%>&newsitemid=<%=itemIds[0]%><%=("0".equals(pid)?"":"&pid="+pid)%>">&nbsp;<< Back</a></td><%
				} 
	            else {
					if(request.getHeader("referer") != null && request.getHeader("referer").indexOf("/content.jsp") == -1) {
						%><td><a class="LinkIndex" href="<%=request.getHeader("referer")%>">&nbsp;<< Back</a></td><%
					}
				}
	            if(itemIds[1] > 0 ) {
	            	%><td align="right"><a class="LinkIndex" href="content.jsp?page=<%=thisPage%>&ftitle=<%=feedId%>&feed=<%=feedId%>&newsitemid=<%=itemIds[1]%><%=("0".equals(pid)?"":"&pid="+pid)%>">Next >>&nbsp;</a></td><%
	            }
	            %>
	            </tr></table>
				<%
            } catch (Exception e) {
                log.error("Exception = ", e);
                %>
                Unable to get News Navigation.<br /><a href="<%=strThisPageRequestUrl%>">Click here to refresh the page</a>
				<%
            }
			%>
    		</div>
		</div>


	<%
    } // if data found check
    else {
	%>
    	<div id="newsBlock" id="newsBlock">
        	Unable to get news headlines.<br /><a href="<%=strThisPageRequestUrl%>">Click here to refresh the page</a>
    	</div>
        
	<%
    }
	%>

<div style="padding:0px 0px 0px 0px;text-decoration: underline;">
            <jsp:include page="../banner.jsp">
                <jsp:param name="w" value="<%=width%>"/>
            </jsp:include>
</div>

<%@ include file="../includes/footer.jspf"%>



<%
wpb.LogVisit(strIP, thisPage, strGsm,strApn,strBrand,strModel, app,request.getQueryString());
%>